package dog.gui;

import java.awt.Color;
import java.awt.Component;

import javax.swing.*;

import containers.Person;

public class PersonCellRenderer implements ListCellRenderer
	{

	@Override
	public Component getListCellRendererComponent(JList source, Object obj, int index, boolean selected, boolean focus)
		{
		Person p = (Person)obj;
		JLabel label = new JLabel(p.email);
		label.setOpaque(true);
		if (selected)
			{
			if(focus)
				{
				
				label.setBackground(new Color(0,0,128));
				label.setForeground(new Color(255,255,255));
				}
			else
				label.setBackground(new Color(192,192,192));
			}
		return label;
		}
	}
